package com.zzxx;

import com.zzxx.entity.Activity;
import com.zzxx.entity.Rule;
import com.zzxx.mapper.ActivityMapper;
import com.zzxx.mapper.RuleMapper;
import com.zzxx.utils.QrCodeCreateUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;
import java.util.UUID;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations ="classpath:beans.xml")
public class ActivityText {
    @Autowired
    private RuleMapper ruleMapper;

    @Test
    public void Text1(){
        List<Rule> all = ruleMapper.findAll();
    }
//    @Test
//    public void Text2(){
//        QrCodeCreateUtils.CodeCreate("123",500,500,"C:\\Users\\Administrator\\Desktop\\xzf.jpg","jpg");
//    }
//
//    @Test
//    public void test2() {
//        Integer userId = UUID.randomUUID().toString().replaceAll("-","").hashCode();
//        // String.hashCode()可能会是负数，如果为负数需要转换为正数
//        userId = userId < 0 ? -userId : userId;
////        Long num = Long.valueOf(String.valueOf(userId));
//        String num = Integer.toHexString(userId);
//        System.err.println(num);
//    }
//
//    @Test
//    public void name() {
//        QrCodeCreateUtils.CodeCreate("aaaa",180,180,"C:\\Users\\13465\\Desktop\\sql\\qr.jpg","jpg");
//    }
}

